import { Form, Input, Button } from 'antd'

function Home() {
  const [form] = Form.useForm()

  function handleSubmit(values) {
    console.log('values', values);
  }

  function handleEcho() {
    form.setFieldsValue({
      account: '111',
      password: '222'
    })
  }

  return (
    <div>
      <Form form={form} labelCol={{ span: 2 }} onFinish={handleSubmit}>
        <Form.Item label="Account" name="account">
          <Input />
        </Form.Item>
        <Form.Item label="Password" name="password">
          <Input />
        </Form.Item>
        <Form.Item wrapperCol={{ offset: 2 }}>
          <Button htmlType='submit'>Submit</Button>
          <Button onClick={handleEcho}>echo</Button>
        </Form.Item>
      </Form>
    </div>
  )
}

export default Home
